/*
 * @Descripttion:
 * @version:
 * @Author: yuanliutech
 * @Date: 2022-12-05 19:03:01
 * @LastEditors: yuanliutech@lwj
 * @LastEditTime: 2025-02-14 16:55:41
 */

// 角色
export function roleNameTrans(name) {
    if (name == "SUPER_ADMIN") {
        return "超级管理员";
    } else if (name == "PLATFORM_ADMIN") {
        return "运维管理员";
    } else if (name == "TENANT_ADMIN") {
        return "系统管理员";
    } else if (name == "ORG_ADMIN") {
        return "装维人员";
    } else if (name == "NORMAL_USER") {
        return "普通用户";
    }
}

// 产品类型过滤
export function deviceTypeText(name) {
    if (name == "DoorMagnetism") {
        return "门磁";
    } else if (name == "Camera") {
        return "摄像机";
    } else if (name == "GasSensor") {
        return "燃气";
    } else if (name == "Infrared") {
        return "红外";
    } else if (name == "SmokeAlarm") {
        return "烟感";
    } else if (name == "FireHydrant") {
        return "消防水压";
    } else if (name == "TemperatureAlarm") {
        return "温感";
    } else if (name == "WaterSensor") {
        return "水浸";
    } else if (name == "PressureGauge") {
        return "无线数字压力表";
    } else if (name == "TankGauge") {
        return "无线数字液位表";
    } else if (name == "UserTransferDevice") {
        return "用户传输装置";
    } else if (name == "ElectricalMeasurement") {
        return "电气测控装置";
    } else if (name == "FaultArc") {
        return "故障电弧探测器";
    } else if (name == "SoundLightVoiceAlarm") {
        return "声光报警器";
    } else if (name == "FireAlarmController") {
        return "火灾报警控制器";
    } else if (name == "1") {
        return "离子感烟";
    } else if (name == "2") {
        return "点型感温";
    } else if (name == "3") {
        return "点型感烟";
    } else if (name == "4") {
        return "报警接口";
    } else if (name == "5") {
        return "可燃气体";
    } else if (name == "6") {
        return "红外对射";
    } else if (name == "7") {
        return "紫外感光";
    } else if (name == "8") {
        return "缆式感温";
    } else if (name == "9") {
        return "模拟感温";
    } else if (name == "10") {
        return "复合探测";
    } else if (name == "11") {
        return "手动按钮";
    } else if (name == "12") {
        return "消防广播";
    } else if (name == "13") {
        return "讯响器";
    } else if (name == "14") {
        return "消防电话";
    } else if (name == "15") {
        return "消火栓";
    } else if (name == "16") {
        return "消火栓泵";
    } else if (name == "17") {
        return "喷淋泵";
    } else if (name == "18") {
        return "稳压泵";
    } else if (name == "19") {
        return "排烟机";
    } else if (name == "20") {
        return "送风机";
    } else if (name == "21") {
        return "新风机";
    } else if (name == "22") {
        return "防火阀";
    } else if (name == "23") {
        return "排烟阀";
    } else if (name == "24") {
        return "送风阀";
    } else if (name == "25") {
        return "电磁阀";
    } else if (name == "26") {
        return "卷帘门中";
    } else if (name == "27") {
        return "卷帘门下";
    } else if (name == "28") {
        return "防火门";
    } else if (name == "29") {
        return "压力开关";
    } else if (name == "30") {
        return "水流指示";
    } else if (name == "31") {
        return "电梯";
    } else if (name == "32") {
        return "空调机组";
    } else if (name == "33") {
        return "柴油发电";
    } else if (name == "34") {
        return "照明配电";
    } else if (name == "35") {
        return "动力配电";
    } else if (name == "36") {
        return "水幕电磁";
    } else if (name == "37") {
        return "气体启动";
    } else if (name == "38") {
        return "气体停动";
    } else if (name == "39") {
        return "从机";
    } else if (name == "40") {
        return "火灾示盘";
    } else if (name == "41") {
        return "闸阀";
    } else if (name == "42") {
        return "高位水箱";
    } else if (name == "43") {
        return "泡沫泵";
    } else if (name == "44") {
        return "消防电源";
    } else if (name == "45") {
        return "紧急照明";
    } else if (name == "46") {
        return "疏导指示";
    } else if (name == "47") {
        return "喷洒指示";
    } else if (name == "48") {
        return "防盗模块";
    } else if (name == "49") {
        return "信号碟阀";
    } else if (name == "50") {
        return "防排烟阀";
    } else if (name == "51") {
        return "水幕泵";
    } else if (name == "52") {
        return "层号灯";
    } else if (name == "53") {
        return "设备停动";
    } else if (name == "54") {
        return "泵故障";
    } else if (name == "55") {
        return "急启按钮";
    }
}

// 产品类型过滤
export function deviceTypeText2(name) {
    if (name == "DoorMagnetism") {
        return "门磁";
    } else if (name == "Camera") {
        return "摄像机";
    } else if (name == "GasSensor") {
        return "智能燃气报警器";
    } else if (name == "Infrared") {
        return "红外探测器";
    } else if (name == "SmokeAlarm") {
        return "烟感探测报警器";
    } else if (name == "FireHydrant") {
        return "消防水压";
    } else if (name == "TemperatureAlarm") {
        return "温感火灾探测报警器";
    } else if (name == "WaterSensor") {
        return "水浸探测器";
    } else if (name == "PressureGauge") {
        return "无线数字压力表";
    } else if (name == "TankGauge") {
        return "无线数字液位表";
    } else if (name == "UserTransferDevice") {
        return "用户信息传输装置";
    } else if (name == "ElectricalMeasurement") {
        return "电气综合测控装置";
    } else if (name == "FaultArc") {
        return "故障电弧探测器";
    } else if (name == "SoundLightVoiceAlarm") {
        return "声光报警器";
    } else if (name == "FireAlarmController") {
        return "火灾报警控制器";
    } else if (name == "1") {
        return "离子感烟";
    } else if (name == "2") {
        return "点型感温";
    } else if (name == "3") {
        return "点型感烟";
    } else if (name == "4") {
        return "报警接口";
    } else if (name == "5") {
        return "可燃气体";
    } else if (name == "6") {
        return "红外对射";
    } else if (name == "7") {
        return "紫外感光";
    } else if (name == "8") {
        return "缆式感温";
    } else if (name == "9") {
        return "模拟感温";
    } else if (name == "10") {
        return "复合探测";
    } else if (name == "11") {
        return "手动按钮";
    } else if (name == "12") {
        return "消防广播";
    } else if (name == "13") {
        return "讯响器";
    } else if (name == "14") {
        return "消防电话";
    } else if (name == "15") {
        return "消火栓";
    } else if (name == "16") {
        return "消火栓泵";
    } else if (name == "17") {
        return "喷淋泵";
    } else if (name == "18") {
        return "稳压泵";
    } else if (name == "19") {
        return "排烟机";
    } else if (name == "20") {
        return "送风机";
    } else if (name == "21") {
        return "新风机";
    } else if (name == "22") {
        return "防火阀";
    } else if (name == "23") {
        return "排烟阀";
    } else if (name == "24") {
        return "送风阀";
    } else if (name == "25") {
        return "电磁阀";
    } else if (name == "26") {
        return "卷帘门中";
    } else if (name == "27") {
        return "卷帘门下";
    } else if (name == "28") {
        return "防火门";
    } else if (name == "29") {
        return "压力开关";
    } else if (name == "30") {
        return "水流指示";
    } else if (name == "31") {
        return "电梯";
    } else if (name == "32") {
        return "空调机组";
    } else if (name == "33") {
        return "柴油发电";
    } else if (name == "34") {
        return "照明配电";
    } else if (name == "35") {
        return "动力配电";
    } else if (name == "36") {
        return "水幕电磁";
    } else if (name == "37") {
        return "气体启动";
    } else if (name == "38") {
        return "气体停动";
    } else if (name == "39") {
        return "从机";
    } else if (name == "40") {
        return "火灾示盘";
    } else if (name == "41") {
        return "闸阀";
    } else if (name == "42") {
        return "高位水箱";
    } else if (name == "43") {
        return "泡沫泵";
    } else if (name == "44") {
        return "消防电源";
    } else if (name == "45") {
        return "紧急照明";
    } else if (name == "46") {
        return "疏导指示";
    } else if (name == "47") {
        return "喷洒指示";
    } else if (name == "48") {
        return "防盗模块";
    } else if (name == "49") {
        return "信号碟阀";
    } else if (name == "50") {
        return "防排烟阀";
    } else if (name == "51") {
        return "水幕泵";
    } else if (name == "52") {
        return "层号灯";
    } else if (name == "53") {
        return "设备停动";
    } else if (name == "54") {
        return "泵故障";
    } else if (name == "55") {
        return "急启按钮";
    }
}

// 告警类型过滤
export function alarmTypeText(val) {
    let value = "";
    if (val == 1) {
        value = "低电压告警";
    } else if (val == 2) {
        value = "设备被拆除告警";
    } else if (val == 3) {
        value = "开门告警";
    } else if (val == 4) {
        value = "监测到活动告警";
    } else if (val == 5) {
        value = "烟雾浓度过高告警";
    } else if (val == 6) {
        value = "燃气传感器故障";
    } else if (val == 7) {
        value = "烟雾传感器故障告警";
    } else if (val == 8) {
        value = "温度传感器故障告警";
    } else if (val == 9) {
        value = "拆除故障告警";
    } else if (val == 10) {
        value = "高温告警";
    } else if (val == 11) {
        value = "低压故障";
    } else if (val == 12) {
        value = "高浓度告警";
    } else if (val == 13) {
        value = "关门告警";
    } else if (val == 14) {
        value = "断电告警";
    } else if (val == 15) {
        value = "低电量";
    } else if (val == 16) {
        value = "通信信号差";
    } else if (val == 17) {
        value = "消息上报失败";
    } else if (val == 18) {
        value = "网络初始化失败";
    } else if (val == 19) {
        value = "压力值超下限";
    } else if (val == 20) {
        value = "压力值超上限";
    } else if (val == 21) {
        value = "压力波动超限";
    } else if (val == 22) {
        value = "压力传感器故障";
    } else if (val == 23) {
        value = "NB低电量报警";
    } else if (val == 24) {
        value = "温湿度传感器故障";
    } else if (val == 25) {
        value = "自检";
    } else if (val == 26) {
        value = "水浸告警";
    } else if (val == 27) {
        value = "高报警";
    } else if (val == 28) {
        value = "低报警";
    } else if (val == 30) {
        value = "火警告警";
    } else if (val == 31) {
        value = "火情告警";
    } else if (val == 32) {
        value = "手动报警";
    } else if (val == 33) {
        value = "模拟告警";
    } else if (val == 34) {
        value = "漏电告警";
    } else if (val == 35) {
        value = "过压告警";
    } else if (val == 36) {
        value = "欠压告警";
    } else if (val == 37) {
        value = "缺相告警";
    } else if (val == 38) {
        value = "过流告警";
    } else if (val == 39) {
        value = "过载告警";
    } else if (val == 40) {
        value = "电弧告警";
    } else if (val == 41) {
        value = "报警";
    } else if (val == 42) {
        value = "离线";
    } else {
        value = "其它告警";
    }
    return value;
}

// 隐患类型过滤
export function hiddenDangerTypeText(name) {
    if (name == "1") {
        return "低电压";
    } else if (name == "2") {
        return "低电量";
    } else if (name == "3") {
        return "燃气传感器故障";
    } else if (name == "4") {
        return "烟雾传感器故障";
    } else if (name == "5") {
        return "温度传感器故障";
    } else if (name == "6") {
        return "压力传感器故障";
    } else if (name == "7") {
        return "温湿度传感器故障";
    } else if (name == "8") {
        return "NB低电量";
    } else if (name == "9") {
        return "硬件异常";
    } else if (name == "10") {
        return "主电故障";
    } else if (name == "11") {
        return "用传备电故障";
    } else if (name == "12") {
        return "检测连接线路故障";
    } else if (name == "13") {
        return "传感器异常";
    } else if (name == "14") {
        return "漏电传感器接触故障";
    } else if (name == "15") {
        return "故障";
    } else if (name == "98") {
        return "故障";
    } else if (name == "99") {
        return "其他";
    }
}

// 隐患源
export function hiddenDangerSourceText(name) {
    if (name == "0") {
        return "设备上报";
    } else if (name == "1") {
        return "人工上报";
    }
}

// 组织监管类型
export function flatTypeText(name) {
    if (name == "1") {
        return "九小场所";
    } else if (name == "2") {
        return "高危单位";
    } else if (name == "3") {
        return "重点单位";
    } else if (name == "4") {
        return "一般单位";
    } else if (name == "5") {
        return "高层建筑";
    } else if (name == "6") {
        return "其他单位";
    } else if (name == "7") {
        return "超大综合体";
    } else if (name == "8") {
        return "化工企业";
    } else if (name == "9") {
        return "地下建筑";
    }
}


export function natureText(name) {
    if (name == "1") {
        return "国有企业";
    } else if (name == "2") {
        return "集体企业";
    } else if (name == "3") {
        return "民营企业";
    } else if (name == "4") {
        return "个体工商户";
    } else if (name == "5") {
        return "中外合资企业";
    } else if (name == "6") {
        return "外商独资企业";
    } else if (name == "7") {
        return "股份制企业";
    } else if (name == "8") {
        return "事业组织";
    } else if (name == "9") {
        return "国家组织";
    } else if (name == "10") {
        return "照明场所";
    } else if (name == "11") {
        return "其他";
    }
}

export function categoryText(name) {
    if (name == "1") {
        return "医院";
    } else if (name == "2") {
        return "科研组织";
    } else if (name == "3") {
        return "住宅";
    } else if (name == "4") {
        return "体育场";
    } else if (name == "5") {
        return "工厂";
    } else if (name == "6") {
        return "学校";
    } else if (name == "7") {
        return "养老院";
    } else if (name == "8") {
        return "政府机构";
    } else if (name == "9") {
        return "车站";
    } else if (name == "10") {
        return "码头";
    } else if (name == "11") {
        return "企业";
    } else if (name == "12") {
        return "商店";
    } else if (name == "13") {
        return "宾馆";
    } else if (name == "14") {
        return "其他";
    } else if (name == "15") {
        return "非营利性机构";
    }
}

export function gradeText(name) {
    if (name == "1") {
        return "一级消防安全重点组织";
    } else if (name == "2") {
        return "二级消防安全重点组织";
    } else if (name == "3") {
        return "三级消防安全重点组织";
    } else if (name == "4") {
        return "非消防安全重点组织";
    }
}

export function orgStatsText(name) {
    if (name == "1") {
        return "联网单位";
    } else if (name == "2") {
        return "维保单位";
    } else if (name == "3") {
        return "监管单位";
    } else if (name == "4") {
        return "经销商";
    } else if (name == "5") {
        return "工程商";
    } else if (name == "6") {
        return "代理商";
    }
}